﻿//-----------------------------------------------------------------------
// <copyright file="ContentPages.cs" company="Craig Longford (deltawolf7@gmail.com)">
//     Copyright (c) Craig Longford. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Delta.Mercury.Business.Web
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using Delta.Data.DataExpress;

    /// <summary>
    /// Content pages collection
    /// </summary>
    [Serializable]
    public class ContentPages : List<ContentPage>
    {
        #region Load Method
        /// <summary>
        /// Load content pages from datasource
        /// </summary>
        /// <returns>Collection of ContentPages</returns>
        public static ContentPages Load()
        {
            return DataAccess.GetCollection<ContentPages, ContentPage>("LoadContentPages", CommandType.StoredProcedure);
        }
        #endregion

        #region Search Method
        /// <summary>
        /// Search content pages
        /// </summary>
        /// <param name="keywords">Search query</param>
        /// <returns>Contect page collection</returns>
        public static ContentPages Search(string keywords)
        {
            Parameters parameters = new Parameters();
            parameters.Add(new Parameter("Keywords", keywords));
            return DataAccess.GetCollection<ContentPages, ContentPage>("SearchContentPages", CommandType.StoredProcedure, parameters);
        }
        #endregion
    }
}

